#ifndef	_DRV_SOFT_SPI_H_
#define _DRV_SOFT_SPI_H_
#include "drv_common.h"
#include "hc32_common.h"
#include "drv_pin.h"

EXTERN_STRUCT
	uint32_t cs_pin;
	uint32_t clk_pin;
	uint32_t sdi_pin;
	uint32_t sdo_pin;
	uint8_t  delay_us;
END_EXTERN_STRUCT(Drv_Soft_Spi_Bus)

void drv_soft_spi_write_byte(Drv_Soft_Spi_Bus *spi_bus,uint8_t regAddr,uint8_t data);
uint8_t drv_soft_spi_read_byte(Drv_Soft_Spi_Bus *spi_bus,uint8_t regAddr);
int8_t drv_soft_spi_register(Drv_Soft_Spi_Bus *spi_bus,uint32_t cs_pin,uint32_t clk_pin,uint32_t sdi_pin,uint32_t sdo_pin,uint8_t  delay_us);

#endif